package service

import (
	"palms/model"
	"palms/repository"
)

type SellerService interface {
	MatchAll(sellerCode string) (*model.Robot, error)
}

func NewSellerService(repo repository.RoomRepository) SellerService {
	return &sellerService{
		repo: repo,
	}
}

type sellerService struct {
	robotService RobotService
	repo         repository.SellerRepository
}

func (s sellerService) MatchAll(sellerCode string) (*model.Robot, error) {
	var tags = []string{sellerCode, sellerCode}
	all, err := s.robotService.MatchAll(tags)
	if err != nil {
		return nil, err
	}
	robot := all[0]
	return &robot, nil
}
